package com.sneakxy.mybase4j.platform.service;

import com.alibaba.dubbo.config.annotation.Reference;

import com.sneakxy.mybase4j.base.service.BaseService;

import com.sneakxy.mybase4j.platform.beans.AccountRole;
import com.sneakxy.mybase4j.platform.beans.AccountRoleId;

import com.sneakxy.mybase4j.platform.provider.IAccountRoleProvider;

import com.sneakxy.mybase4j.platform.service.IAccountRoleService;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import org.springframework.stereotype.Service;

/**
 * 
 * @author 潜行的青衣
 * @see
 */
@Service
public class AccountRoleService extends BaseService<AccountRole, AccountRoleId, IAccountRoleProvider> implements IAccountRoleService {

	@Reference(version = "1.0.0")
	@Autowired(required = false)
	@Qualifier("accountRoleProvider")
	private IAccountRoleProvider provider;

	@Override
	public IAccountRoleProvider getProvider() {
		return this.provider;
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.service.IAccountRoleService#findRoles(java.lang.String)
	 */
	@Override
	public List<String> findRoles(String account_id) {
		return this.getProvider().findRoles(account_id);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.service.IAccountRoleService#deleteByRoleId(java.lang.String)
	 */
	@Override
	public int deleteByRoleId(String roleId) {
		return this.getProvider().deleteByRoleId(roleId);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.service.IAccountRoleService#deleteByAccountId(java.lang.String)
	 */
	@Override
	public int deleteByAccountId(String accountId) {
		return this.getProvider().deleteByAccountId(accountId);
	}

}
